﻿/********************************************************************************************************************
* Author:	Christos Polydorou																						*
* Email:	std04237@di.uoa.gr																						*
* Purpose:	This script is used in order to create the stored procedure "usp_user_setuser" that updates all columns *
*			for the user with the specified username.																*
********************************************************************************************************************/

CREATE PROCEDURE [dbo].[usp_user_setuser]
	@username nvarchar(50),
	@password nvarchar(50),
	@email nvarchar(50),
	@usertype nvarchar(3),
	@fname nvarchar(50),
	@lname nvarchar(50)
AS
	UPDATE Users
	SET password = @password, Email = @email, Usertype = @usertype, fname = @fname, lname = @lname
	WHERE Users.username = @username
RETURN 0